<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
$pool = [
    'min_connections' => 1,
    'max_connections' => 50,
    'connect_timeout' => 3.0,
    'wait_timeout'    => 3.0,
    'heartbeat'       => -1,
    'max_idle_time'   => (float)env('REDIS_MAX_IDLE_TIME', 5)
];

return [
    'qm_1'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 2,
        'pool' => $pool
    ],
    'qm_2'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 2,
        'pool' => $pool
    ],
    'qm_3'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 3,
        'pool' => $pool
    ],
    'qm_4'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 4,
        'pool' => $pool
    ],
    'qm_5'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 5,
        'pool' => $pool
    ],
    'qm_6'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 6,
        'pool' => $pool
    ],
    'qm_7'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 7,
        'pool' => $pool
    ],
    'qm_8'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 8,
        'pool' => $pool
    ],
    'qm_9'    => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 9,
        'pool' => $pool
    ],
    'default' => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => (int)env('REDIS_DB', 10),
        'pool' => $pool
    ],
    'qm_11'   => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 11,
        'pool' => $pool
    ],
    'qm_12'   => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 12,
        'pool' => $pool
    ],
    'qm_13'   => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 13,
        'pool' => $pool
    ],
    'qm_14'   => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 14,
        'pool' => $pool
    ],
    'qm_15'   => [
        'host' => env('REDIS_HOST', 'localhost'),
        'auth' => env('REDIS_AUTH', null),
        'port' => (int)env('REDIS_PORT', 6379),
        'db'   => 15,
        'pool' => $pool
    ]
];
